/*package com.zjzywl.iotSendthings.util;

import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.security.KeyStore.Entry.Attribute;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;

import com.zjzywl.iotSendthings.configuration.AppConfig;

 

public class TestXml {

 *//**
  * @param args
 * @throws UnsupportedEncodingException s
  *//*
 public static void main(String[] args) throws UnsupportedEncodingException {
	 ResponseEntity<String> exchange = config.restTemplate().exchange(
				config.getServerIp() + "/p2/MJXX.jsp/" + username + "/" + password, HttpMethod.GET, null, String.class);
		Map<String, String> map= new HashMap<>();
		String aaa ="<?xml version=\"1.0\" encoding=\"GBK\" ?> \r\n" + 
				"<tran:transfer xmlns:tran=\"http://xztran/tran\" xmlns:jgry=\"http://xztran/jgry\">\r\n" + 
				"<jgry:record jgry:ryid=\"360502196206010052\" jgry:czlx=\"u\" jgry:sjlx=\"01\">\r\n" + 
				"<jgry:jbxx>\r\n" + 
				"<jgry:xm>\r\n" + 
				"<jgry:type>1</jgry:type> \r\n" + 
				"<jgry:value>徐绍华</jgry:value> \r\n" + 
				"</jgry:xm>\r\n" + 
				"<jgry:zjhm>\r\n" + 
				"<jgry:type>1</jgry:type> \r\n" + 
				"<jgry:value>360502196206010052</jgry:value> \r\n" + 
				"</jgry:zjhm>\r\n" + 
				"<jgry:mjbh>\r\n" + 
				"<jgry:type>1</jgry:type> \r\n" + 
				"<jgry:value>360500121201111040007</jgry:value> \r\n" + 
				"</jgry:mjbh>\r\n" + 
				"<jgry:jsbh>\r\n" + 
				"<jgry:type>1</jgry:type> \r\n" + 
				"<jgry:value>360500121</jgry:value> \r\n" + 
				"</jgry:jsbh>\r\n" + 
				"</jgry:jbxx>\r\n" + 
				"</jgry:record>\r\n" + 
				"<jgry:zmzp /> \r\n" + 
				"</tran:transfer>";
		try { // 创建xml解析对象
			SAXReader reader = new SAXReader();
			// 定义一个文档
			Document document = null;
			// 将字符串转换为
			document = reader.read(new ByteArrayInputStream(aaa.getBytes("GBK")));
			// 得到xml的根节点(message)
			Element bookStore = document.getRootElement();
			Element record = bookStore.element("record");
			Element jbxx = record.element("jbxx");
			System.out.println(jbxx.getNamespace().getPrefix());
			// 通过element对象的elementIterator方法获取迭代器
			Iterator it = record.elementIterator();
			// 遍历迭代器，获取根节点中的信息（书籍）
			while (it.hasNext()) {
				System.out.println("=====开始遍历某一本书=====");
				Element book = (Element) it.next();
				// 获取book的属性名以及 属性值
				List<Attribute> bookAttrs = book.attributes();
				for (Attribute attr : bookAttrs) {
					System.out.println("属性名：" + attr.getName() + "--属性值：" + attr.getValue());
				}
				Iterator itt = book.elementIterator();
				while (itt.hasNext()) {
					Element bookChild = (Element) itt.next();
					System.out.println("节点名：" + bookChild.getName() + "--节点值：" + bookChild.getStringValue());
					map.put(bookChild.getName(), bookChild.getStringValue());
				}
				System.out.println("=====结束遍历某一本书=====");
			}
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

}}*/